<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<h:form id="listaConvenioForm">
		<p:dataTable value="#{convenioBean.listaConvenio}" var="convenio">
			<p:column headerText="Nome">
				<h:outputText value="#{convenio.nomeConvenio}" />
			</p:column>
			<p:column headerText="Acoes">
				<p:commandButton icon="ui-icon-circle-triangle-n"
					action="#{convenioBean.editarConvenio(convenio)}"
					update=":editarConvenioDialog"
					oncomplete="PF('editarConvenioDialog').show();" />
				<p:commandButton icon="ui-icon-circle-minus"
					action="#{convenioBean.excluirConvenio(convenio)}"
					update=":listaConvenioForm">
					<p:confirm header="Excluir registro"
						message="Deseja excluir o registro selecionado?"
						icon="ui-icon-alert" />
				</p:commandButton>
			</p:column>
		</p:dataTable>
		<p:commandButton icon="ui-icon-circle-plus"
			action="#{convenioBean.adicionarConvenio}"
			oncomplete="PF('editarConvenioDialog').show();"
			update=":editarConvenioDialog" />
		<p:commandButton icon="ui-icon-circle-close"
			onclick="PF('listarConvenioDialog').hide();">
		</p:commandButton>
	</h:form>
</ui:composition>
</html>